package com.will.yuaiagent.common;

import com.will.yuaiagent.exception.ErrorCode;

import java.io.Serializable;

/**
 * @author will
 * @since 2025/6/26 09:34
 */
public class BaseReponse<T> implements Serializable {
    private static final long serialVersionUID = -1L;

    private int code;
    private T data;
    private String message;

    public BaseReponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public BaseReponse(int code, T data) {
        this(code, data, "");
    }

    public BaseReponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null, errorCode.getMessage());
    }
}
